﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace TStart
{
    static class Program
    {
        /// <summary>
        /// 应用程序的主入口点。
        /// </summary>
        [STAThread]
        static void Main()
        {
            bool create_new = false;
            string name = Convert.ToBase64String(Encoding.Default.GetBytes(Application.StartupPath));
            using (Semaphore sem = new Semaphore(0, 65536, name, out create_new))
            {
                if (create_new)
                {
                    Application.EnableVisualStyles();
                    Application.SetCompatibleTextRenderingDefault(false);
                    Application.Run(new frmMain(sem));
                }
                else
                {
                    sem.Release();
                }
            }
        }
    }
}
